<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-img</title>
</head>

<body>
    <div id="app">
        <button v-show="index>0" @click="index--">上一张</button>
        <div>
            <img :src="list[index]" alt="">
        </div>
        <button  v-show="index<list.length-1" @click="index++">下一张</button>
    </div>
 
    <!-- 引入包-->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                index:0,
                list:[
                'https://pic.rmb.bdstatic.com/bjh/5c637ccb84ec15b13dde24b2c6c9090a.jpeg',
                'https://img0.baidu.com/it/u=946423536,1171397954&fm=253&fmt=auto&app=138&f=JPEG?w=667&h=500',
                'https://img2.baidu.com/it/u=962777280,2319124389&fm=253&fmt=auto&app=138&f=JPEG?w=667&h=500',
                'https://img1.baidu.com/it/u=2146168709,2834625354&fm=253&fmt=auto&app=120&f=JPEG?w=667&h=500'
                ]
            }
        })
    </script>
</body>

</html>